#ifndef _SPRITE_H_
	#define _SPRITE_H_

#include <string>
#include "sdl.h"
#include "CSurface.h"

// some pre-definitions needed for our class!
const int X_MAX = 640;
const int Y_MAX = 480;

/*
	Point
		- used to represent our objects in the xy-coordinate system
*/
struct Point
{
	int x;
	int y;
	Point() { x = 0; y = 0; }
	Point(int X, int Y) { x = X; y = Y; }
};

/*	speed
		- used to represent the vector displacement of a "Point" (see above description for "Point")
*/
struct Speed
{
	Point p;
	float xSpeed;
	float ySpeed;
	Speed() { p.x = p.y = 0; xSpeed = 0; ySpeed = 0;}  
	Speed(Point P, float XSpeed, float YSpeed) { p = P; xSpeed = XSpeed; ySpeed = YSpeed; }
};

/* 	acceleration
		- used to show the rate at which "speed" changes (see above description for "speed")
*/
struct Acceleration
{
	Speed s;
	float xAccel;
	float yAccel;
	Acceleration()
	{
		s.p.x = s.p.y = 0;
		xAccel = yAccel = 0;
	}
};

/*	Sprite
		- Class used to represent a game object
		- Contains methods that should be applicable to ALL types of object derivatives
*/
class Sprite
{
	public:
		// general attributes
		char* filename;		// contains the object's filename
		SDL_Surface* surf;		// picture source
		
		// coordinate attributes
		int height;				// object height
		int width;				// object width
		Point location;			// object's coordinate location
		float rotation;			// object's orientation
		Speed speed;			// object speed
		SDL_Rect boundingBox;	// object's collision box

		// data flags
		bool isAlive;			// Is this object active in the game?
		bool isCollidable;		// Are we able to collide with this object?

		// methods
//		Sprite();
//		~Sprite();

		// methods are left empty...to be defined by the children

		/* Accepts all and filters any inputs into the game
		   Parameters:
				- SDL_Event& event: The event that we wish to process
	    */
		void input(SDL_Event& event);	

		/* Updates all game states and object values */
		void update();					

		/* Renders all drawable game objects to the screen */
		void draw(SDL_Surface* Display);

		/* Detect whether if the object collided with another object */
		bool checkCollision(Sprite object);
};

/*
Sprite::Sprite()
{
	filename = "";
	surf = NULL;
	location.x = location.y = 0;
	speed.p = location;
	speed.xSpeed = speed.ySpeed = 0.0;
	height = 0;
	width = 0;
	rotation = 0.0;

	isAlive = false;
	isCollidable = false;
}
Sprite::~Sprite() { SDL_FreeSurface(surf); }
*/
#endif



